
#include "spserver.h"
#include "NetworkObject.h"
#include "Session.h"

NetworkObject::NetworkObject()
{
	m_pSession = NULL;
}

NetworkObject::~NetworkObject()
{

}

void NetworkObject::Disconnect(bool bGrace /* = true */)
{
	if (m_pSession)
	{
		m_pSession->Disconnect(bGrace);
	}
}

bool NetworkObject::Send(unsigned char* pMsg, size_t nSize)
{
	if (!m_pSession)
	{
		return false;
	}

	if (m_pSession->ShouleBeRemove())
	{
		return false;
	}

	return m_pSession->Send(pMsg, nSize);

}
